export default function define(Python: Blockly.BlockGenerators) {

  Python['compasscalibrate'] = function (block) {
    // TODO: Assemble Python into code variable.
    let code = 'compass.calibrate()\n';
    return code;
  };

  Python['compasscalibrated'] = function (block) {
    let code = 'compass.is_calibrated()';
    return [code, Blockly.Python.ORDER_ATOMIC];
  };
	
  Python['compass_x'] = function (block) {
    let variable_variable = Blockly.Python.variableDB_.getName(block.getFieldValue('variable'), Blockly.Variables.NAME_TYPE);
    // TODO: Assemble Python into code variable.
    let code = variable_variable + ' = compass.get_x()\n';
    return code;
  };

  Python['compass_y'] = function (block) {
    let variable_variable = Blockly.Python.variableDB_.getName(block.getFieldValue('variable'), Blockly.Variables.NAME_TYPE);
    // TODO: Assemble Python into code variable.
    let code = variable_variable + ' = compass.get_y()\n';
    return code;
  };

  Python['compass_z'] = function (block) {
    let variable_variable = Blockly.Python.variableDB_.getName(block.getFieldValue('variable'), Blockly.Variables.NAME_TYPE);
    // TODO: Assemble Python into code variable.
    let code = variable_variable + ' = compass.get_z()\n';
    return code;
  };

  Python['compass_heading'] = function (block) {
    let variable_variable = Blockly.Python.variableDB_.getName(block.getFieldValue('variable'), Blockly.Variables.NAME_TYPE);
    // TODO: Assemble Python into code variable.
    let code = variable_variable + ' = compass.get_heading()\n';
    return code;
  };

  Python['compass_fs'] = function (block) {
    let variable_variable = Blockly.Python.variableDB_.getName(block.getFieldValue('variable'), Blockly.Variables.NAME_TYPE);
    // TODO: Assemble Python into code variable.
    let code = variable_variable + ' = compass.get_field_strength()\n';
    return code;
  };
   
}
